<ion-view left-buttons="leftButtons"
          class="view-notification">
  <ion-nav-title>
    {{'SUBSCRIPTION.EDIT.TITLE' | translate}}
  </ion-nav-title>

  <ion-nav-buttons side="secondary">

  </ion-nav-buttons>

  <ion-content class="padding no-padding-xs" scroll="true">

    <ion-refresher pulling-text="{{:locale:'COMMON.BTN_REFRESH' | translate}}"
                   on-refresh="load()">
    </ion-refresher>

    <!-- Buttons bar -->
    <div class="hidden-xs hidden-sm padding text-center">

      <button class="button button-stable button-small-padding icon ion-loop ink"
              ng-click="load()"
              title="{{'COMMON.BTN_REFRESH' | translate}}">
      </button>

      <button class="button button-calm ink"
              ng-click="addSubscription()">
        {{'SUBSCRIPTION.BTN_ADD' | translate}}
      </button>
    </div>

    <div class="center padding" ng-if="search.loading">
      <ion-spinner icon="android"></ion-spinner>
    </div>

    <div class="center padding gray" ng-if="!search.loading && !search.results.length" translate>
      SUBSCRIPTION.NO_SUBSCRIPTION
    </div>

    <div class="row no-padding">
      <div class="col col-20 hidden-xs hidden-sm">&nbsp;</div>

      <div class="col list {{::motion.ionListClass}} item-border-large">

        <!-- emails -->
        <ng-repeat ng-repeat="subscriptions in search.results | filter: { type: 'email' }"
                   ng-include="'plugins/es/templates/subscription/item_' + subscriptions.type.toLowerCase() + '_subscription.html'">>
        </ng-repeat>

      </div>

      <div class="col col-20 hidden-xs hidden-sm">&nbsp;</div>

    </div>

  </ion-content>

  <button id="fab-add-subscription-record"
          class="button button-fab button-fab-bottom-right button-assertive icon ion-plus hidden-md hidden-lg spin"
          ng-click="addSubscription()">
  </button>

</ion-view>
